nethackfandomcom-20200214-history
Source:SLASH'EM 0.0.7E7F2/winprocs.h
Below is the full text to winprocs.h from the source code of SLASH'EM 0.0.7E7F2. To link to a particular line, write [[SLASH'EM 0.0.7E7F2/winprocs.h#line123]], for example. The latest source code for vanilla NetHack is at Source code. 1. /* SCCS Id: @(#)winprocs.h 3.4 2003/01/08 */ 2. /* Copyright © David Cohrs, 1992 */ 3. /* NetHack may be freely redistributed. See license for details. */ 4. 5. #ifndef WINPROCS_H 6. #define WINPROCS_H 7. 8. struct window_procs { 9. const char *name; 10. unsigned long wincap; /* window port capability options supported */ 11. unsigned long wincap2; /* additional window port capability options supported */ 12. void FDECL((*win_init_nhwindows), (int *, char **)); 13. void NDECL((*win_player_selection)); 14. void NDECL((*win_askname)); 15. void NDECL((*win_get_nh_event)) ; 16. void FDECL((*win_exit_nhwindows), (const char *)); 17. void FDECL((*win_suspend_nhwindows), (const char *)); 18. void NDECL((*win_resume_nhwindows)); 19. winid FDECL((*win_create_nhwindow), (int)); 20. void FDECL((*win_clear_nhwindow), (winid)); 21. void FDECL((*win_display_nhwindow), (winid, BOOLEAN_P)); 22. void FDECL((*win_destroy_nhwindow), (winid)); 23. void FDECL((*win_curs), (winid,int,int)); 24. void FDECL((*win_putstr), (winid, int, const char *)); 25. #ifdef FILE_AREAS 26. void FDECL((*win_display_file), (const char *, const char *, BOOLEAN_P)); 27. #else 28. void FDECL((*win_display_file), (const char *, BOOLEAN_P)); 29. #endif 30. void FDECL((*win_start_menu), (winid)); 31. void FDECL((*win_add_menu), (winid,int,const ANY_P *, 32. CHAR_P,CHAR_P,int,const char *, BOOLEAN_P)); 33. void FDECL((*win_end_menu), (winid, const char *)); 34. int FDECL((*win_select_menu), (winid, int, MENU_ITEM_P **)); 35. char FDECL((*win_message_menu), (CHAR_P,int,const char *)); 36. void NDECL((*win_update_inventory)); 37. void NDECL((*win_mark_synch)); 38. void NDECL((*win_wait_synch)); 39. #ifdef CLIPPING 40. void FDECL((*win_cliparound), (int, int)); 41. #endif 42. #ifdef POSITIONBAR 43. void FDECL((*win_update_positionbar), (char *)); 44. #endif 45. void FDECL((*win_print_glyph), (winid,XCHAR_P,XCHAR_P,int)); 46. void FDECL((*win_raw_print), (const char *)); 47. void FDECL((*win_raw_print_bold), (const char *)); 48. int NDECL((*win_nhgetch)); 49. int FDECL((*win_nh_poskey), (int *, int *, int *)); 50. void NDECL((*win_nhbell)); 51. int NDECL((*win_doprev_message)); 52. char FDECL((*win_yn_function), (const char *, const char *, CHAR_P)); 53. void FDECL((*win_getlin), (const char *,char *)); 54. int NDECL((*win_get_ext_cmd)); 55. void FDECL((*win_number_pad), (int)); 56. void NDECL((*win_delay_output)); 57. #ifdef CHANGE_COLOR 58. void FDECL((*win_change_color), (int,long,int)); 59. #ifdef MAC 60. void FDECL((*win_change_background), (int)); 61. short FDECL((*win_set_font_name), (winid, char *)); 62. #endif 63. char * NDECL((*win_get_color_string)); 64. #endif 65. 66. /* other defs that really should go away (they're tty specific) */ 67. void NDECL((*win_start_screen)); 68. void NDECL((*win_end_screen)); 69. 70. void FDECL((*win_outrip), (winid,int)); 71. void FDECL((*win_preference_update), (const char *)); 72. }; 73. 74. extern NEARDATA struct window_procs windowprocs; 75. 76. /* 77. * If you wish to only support one window system and not use procedure 78. * pointers, add the appropriate #ifdef below. 79. */ 80. 81. #define init_nhwindows (*windowprocs.win_init_nhwindows) 82. #define player_selection (*windowprocs.win_player_selection) 83. #define askname (*windowprocs.win_askname) 84. #define get_nh_event (*windowprocs.win_get_nh_event) 85. #define exit_nhwindows (*windowprocs.win_exit_nhwindows) 86. #define suspend_nhwindows (*windowprocs.win_suspend_nhwindows) 87. #define resume_nhwindows (*windowprocs.win_resume_nhwindows) 88. #define create_nhwindow (*windowprocs.win_create_nhwindow) 89. #define clear_nhwindow (*windowprocs.win_clear_nhwindow) 90. #define display_nhwindow (*windowprocs.win_display_nhwindow) 91. #define destroy_nhwindow (*windowprocs.win_destroy_nhwindow) 92. #define curs (*windowprocs.win_curs) 93. #define putstr (*windowprocs.win_putstr) 94. #define display_file (*windowprocs.win_display_file) 95. #ifdef FILE_AREAS 96. #define display_file_area(area,file,complain) display_file(area,file,complain) 97. #else 98. #define display_file_area(area,file,complain) display_file(file,complain) 99. #endif 100. #define start_menu (*windowprocs.win_start_menu) 101. #define add_menu (*windowprocs.win_add_menu) 102. #define end_menu (*windowprocs.win_end_menu) 103. #define select_menu (*windowprocs.win_select_menu) 104. #define message_menu (*windowprocs.win_message_menu) 105. #define update_inventory (*windowprocs.win_update_inventory) 106. #define mark_synch (*windowprocs.win_mark_synch) 107. #define wait_synch (*windowprocs.win_wait_synch) 108. #ifdef CLIPPING 109. #define cliparound (*windowprocs.win_cliparound) 110. #endif 111. #ifdef POSITIONBAR 112. #define update_positionbar (*windowprocs.win_update_positionbar) 113. #endif 114. #define print_glyph (*windowprocs.win_print_glyph) 115. #define raw_print (*windowprocs.win_raw_print) 116. #define raw_print_bold (*windowprocs.win_raw_print_bold) 117. #define nhgetch (*windowprocs.win_nhgetch) 118. #define nh_poskey (*windowprocs.win_nh_poskey) 119. #define nhbell (*windowprocs.win_nhbell) 120. #define nh_doprev_message (*windowprocs.win_doprev_message) 121. #define getlin (*windowprocs.win_getlin) 122. #define get_ext_cmd (*windowprocs.win_get_ext_cmd) 123. #define number_pad (*windowprocs.win_number_pad) 124. #define delay_output (*windowprocs.win_delay_output) 125. #ifdef CHANGE_COLOR 126. #define change_color (*windowprocs.win_change_color) 127. #ifdef MAC 128. #define change_background (*windowprocs.win_change_background) 129. #define set_font_name (*windowprocs.win_set_font_name) 130. #endif 131. #define get_color_string (*windowprocs.win_get_color_string) 132. #endif 133. 134. /* 3.4.2: There is a real yn_function() in the core now, which does 135. * some buffer length validation on the parameters prior to 136. * invoking the window port routine. yn_function() is in cmd.c 137. */ 138. /* #define yn_function (*windowprocs.win_yn_function) */ 139. 140. /* other defs that really should go away (they're tty specific) */ 141. #define start_screen (*windowprocs.win_start_screen) 142. #define end_screen (*windowprocs.win_end_screen) 143. 144. #define outrip (*windowprocs.win_outrip) 145. #define preference_update (*windowprocs.win_preference_update) 146. 147. /* 148. * WINCAP 149. * Window port preference capability bits. 150. * Some day this might be better in its own wincap.h file. 151. */ 152. #define WC_COLOR 0x01L /* 01 Port can display things in color */ 153. #define WC_HILITE_PET 0x02L /* 02 supports hilite pet */ 154. #define WC_ASCII_MAP 0x04L /* 03 supports an ascii map */ 155. #define WC_TILED_MAP 0x08L /* 04 supports a tiled map */ 156. #define WC_PRELOAD_TILES 0x10L /* 05 supports pre-loading tiles */ 157. #define WC_TILE_WIDTH 0x20L /* 06 prefer this width of tile */ 158. #define WC_TILE_HEIGHT 0x40L /* 07 prefer this height of tile */ 159. #define WC_TILE_FILE 0x80L /* 08 alternative tile file name */ 160. #define WC_INVERSE 0x100L /* 09 Port supports inverse video */ 161. #define WC_ALIGN_MESSAGE 0x200L /* 10 supports message alignmt top|b|l|r */ 162. #define WC_ALIGN_STATUS 0x400L /* 11 supports status alignmt top|b|l|r */ 163. #define WC_VARY_MSGCOUNT 0x800L /* 12 supports varying message window */ 164. #define WC_FONT_MAP 0x1000L /* 13 supports specification of map win font */ 165. #define WC_FONT_MESSAGE 0x2000L /* 14 supports specification of msg win font */ 166. #define WC_FONT_STATUS 0x4000L /* 15 supports specification of sts win font */ 167. #define WC_FONT_MENU 0x8000L /* 16 supports specification of mnu win font */ 168. #define WC_FONT_TEXT 0x10000L /* 17 supports specification of txt win font */ 169. #define WC_FONTSIZ_MAP 0x20000L /* 18 supports specification of map win font */ 170. #define WC_FONTSIZ_MESSAGE 0x40000L /* 19 supports specification of msg win font */ 171. #define WC_FONTSIZ_STATUS 0x80000L /* 20 supports specification of sts win font */ 172. #define WC_FONTSIZ_MENU 0x100000L /* 21 supports specification of mnu win font */ 173. #define WC_FONTSIZ_TEXT 0x200000L /* 22 supports specification of txt win font */ 174. #define WC_SCROLL_MARGIN 0x400000L /* 23 supports setting scroll margin for map */ 175. #define WC_SPLASH_SCREEN 0x800000L /* 24 supports display of splash screen */ 176. #define WC_POPUP_DIALOG 0x1000000L /* 25 supports queries in pop dialogs */ 177. #define WC_SCROLL_AMOUNT 0x2000000L /* 26 scroll this amount at scroll margin */ 178. #define WC_EIGHT_BIT_IN 0x4000000L /* 27 8-bit character input */ 179. #define WC_PERM_INVENT 0x8000000L /* 28 8-bit character input */ 180. #define WC_MAP_MODE 0x10000000L /* 29 map_mode option */ 181. #define WC_WINDOWCOLORS 0x20000000L /* 30 background color for message window */ 182. #define WC_PLAYER_SELECTION 0x40000000L /* 31 background color for message window */ 183. #define WC_MOUSE_SUPPORT 0x80000000L /* 32 mouse support */ 184. /* no free bits */ 185. 186. #define WC2_FULLSCREEN 0x01L /* 01 display full screen */ 187. #define WC2_SOFTKEYBOARD 0x02L /* 02 software keyboard */ 188. #define WC2_WRAPTEXT 0x04L /* 04 wrap long lines of text */ 189. /* 29 free bits */ 190. 191. #define ALIGN_LEFT 1 192. #define ALIGN_RIGHT 2 193. #define ALIGN_TOP 3 194. #define ALIGN_BOTTOM 4 195. 196. /* player_selection */ 197. #define VIA_DIALOG 0 198. #define VIA_PROMPTS 1 199. 200. /* map_mode settings - deprecated */ 201. #define MAP_MODE_TILES 0 202. #define MAP_MODE_ASCII4x6 1 203. #define MAP_MODE_ASCII6x8 2 204. #define MAP_MODE_ASCII8x8 3 205. #define MAP_MODE_ASCII16x8 4 206. #define MAP_MODE_ASCII7x12 5 207. #define MAP_MODE_ASCII8x12 6 208. #define MAP_MODE_ASCII16x12 7 209. #define MAP_MODE_ASCII12x16 8 210. #define MAP_MODE_ASCII10x18 9 211. #define MAP_MODE_ASCII_FIT_TO_SCREEN 10 212. #define MAP_MODE_TILES_FIT_TO_SCREEN 11 213. 214. #if 0 215. #define WC_SND_SOUND 0x01L /* 01 Port has some sound capabilities */ 216. #define WC_SND_SPEAKER 0x02L /* 02 Sound supported via built-in speaker */ 217. #define WC_SND_STEREO 0x04L /* 03 Stereo sound supported */ 218. #define WC_SND_RAW 0x08L /* 04 Raw sound supported */ 219. #define WC_SND_WAVE 0x10L /* 05 Wave support */ 220. #define WC_SND_MIDI 0x20L /* 06 Midi support */ 221. /* 26 free bits */ 222. #endif 223. 224. struct wc_Opt { 225. const char *wc_name; 226. unsigned long wc_bit; 227. }; 228. 229. #endif /* WINPROCS_H */ winprocs.h